gdk: Move gdk_disable_multidevice tot he X11 backend
authorMatthias Clasen <mclasen@redhat.com>
Thu, 23 Nov 2017 21:11:48 +0000 (16:11 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 25 Nov 2017 16:04:14 +0000 (11:04 -0500)
This api only ever did something for X11, so move
it there. Update the docs and adapt the only caller.

docs/reference/gdk/gdk4-sections.txt
gdk/gdkdevicemanager.c
gdk/gdkdevicemanager.h
gdk/gdkglobals.c
gdk/gdkinternals.h
gdk/x11/gdkdevicemanager-x11.c
gdk/x11/gdkx11devicemanager.h
gtk/gtktestutils.c

index a2676fcce72c78e8c7cfa96602ae21449c4062ad..ef7b38c1adf2bd0ad2d2d1c75372a4fa15c43013 100644 (file)
@@ -676,7 +676,6 @@ gdk_seat_capabilities_get_type
 <TITLE>GdkDeviceManager</TITLE>
 <FILE>gdkdevicemanager</FILE>
 GdkDeviceManager
-gdk_disable_multidevice
 gdk_device_manager_get_display
 gdk_device_manager_list_devices
 
@@ -914,6 +913,7 @@ gdk_x11_lookup_xdisplay
 gdk_x11_get_server_time
 gdk_x11_device_get_id
 gdk_x11_device_manager_lookup
+gdk_disable_multidevice
 gdk_x11_display_open
 gdk_x11_display_set_program_class
 gdk_x11_display_get_user_time
index cd133b49ccd0ad8bf5d36bda7267e7a7f2f132e0..22430f60c4a4b27ad9e91e698fa6a931fbbe2f1c 100644 (file)
@@ -339,23 +339,3 @@ gdk_device_manager_list_devices (GdkDeviceManager *device_manager,
 
   return GDK_DEVICE_MANAGER_GET_CLASS (device_manager)->list_devices (device_manager, type);
 }
-
-/**
- * gdk_disable_multidevice:
- *
- * Disables multidevice support in GDK. This call must happen prior
- * to gdk_display_open(), gtk_init() or gtk_init_check() in order to
- * take effect.
- *
- * Most common GTK+ applications won’t ever need to call this. Only
- * applications that do mixed GDK/Xlib calls could want to disable
- * multidevice support if such Xlib code deals with input devices in
- * any way and doesn’t observe the presence of XInput 2.
- *
- * Since: 3.0
- */
-void
-gdk_disable_multidevice (void)
-{
-  _gdk_disable_multidevice = TRUE;
-}
index 7a561099d3dbe02bd1e256d76e5075a63c1b2376..8183b757b0083ea07c67d76d31abe30aaee11ae3 100644 (file)
@@ -41,9 +41,6 @@ GDK_DEPRECATED_IN_3_20
 GList *      gdk_device_manager_list_devices       (GdkDeviceManager *device_manager,
                                                     GdkDeviceType     type);
 
-GDK_AVAILABLE_IN_ALL
-void         gdk_disable_multidevice               (void);
-
 
 G_END_DECLS
 
index d970a8d0e3db4dfb17952bee7f2fc61d18397ff2..b97f6643e30a379c66a62a35201109d404c61587 100644 (file)
@@ -31,7 +31,6 @@
 
 guint               _gdk_debug_flags = 0;
 GList              *_gdk_default_filters = NULL;
-gboolean            _gdk_disable_multidevice = FALSE;
 guint               _gdk_gl_flags = 0;
 guint               _gdk_vulkan_flags = 0;
 GdkRenderingMode    _gdk_rendering_mode = GDK_RENDERING_MODE_SIMILAR;
index 0ef2aaa444809b01318f54da2325f69683c98585..6ea7132c6e0090bca8181f20e98926f0e9af14c9 100644 (file)
@@ -294,7 +294,6 @@ struct _GdkWindow
 #define GDK_WINDOW_DESTROYED(d) (((GdkWindow *)(d))->destroyed)
 
 extern gint       _gdk_screen_number;
-extern gboolean   _gdk_disable_multidevice;
 
 GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
 
index 2e7ea1f41b39fcc14791cea2c39bf1e287d8912f..89036759cd040a1de4678b76d6a591bfd4fd2ae3 100644 (file)
@@ -31,6 +31,8 @@
 #define VIRTUAL_CORE_POINTER_ID 2
 #define VIRTUAL_CORE_KEYBOARD_ID 3
 
+static gboolean _gdk_disable_multidevice = FALSE;
+
 GdkDeviceManager *
 _gdk_x11_device_manager_new (GdkDisplay *display)
 {
@@ -156,3 +158,23 @@ gdk_x11_device_get_id (GdkDevice *device)
 
   return device_id;
 }
+
+/**
+ * gdk_disable_multidevice:
+ *
+ * Disables multidevice support in GDKs X11 backend. This call must happen prior
+ * to gdk_display_open(), gtk_init() or gtk_init_check() in order to
+ * take effect.
+ *
+ * Most common GTK+ applications won’t ever need to call this. Only
+ * applications that do mixed GDK/Xlib calls could want to disable
+ * multidevice support if such Xlib code deals with input devices in
+ * any way and doesn’t observe the presence of XInput 2.
+ *
+ * Since: 3.0
+ */
+void
+gdk_disable_multidevice (void)
+{
+  _gdk_disable_multidevice = TRUE;
+}
index 14918613b5b0742c84002ae698440556d98d75d5..67ef4839464517a2ddd28cb81329f5f40c78a0bf 100644 (file)
@@ -32,6 +32,9 @@ G_BEGIN_DECLS
 GDK_AVAILABLE_IN_3_2
 GdkDevice * gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
                                            gint              device_id);
+GDK_AVAILABLE_IN_ALL
+void         gdk_disable_multidevice (void);
+
 
 G_END_DECLS
 
index 83d2a46aa5aa23cb7b5f6bfa8fbb56a7c7386b94..1a35d2e03412bcdbe3a8adf975188e28d1583453 100644 (file)
 #include <gtk/gtk.h>
 #define GTK_COMPILATION
 
+#ifdef GDK_WINDOWING_X11
+#include <gdk/x11/gdkx.h>
+#endif
+
 /**
  * SECTION:gtktesting
  * @Short_description: Utilities for testing GTK+ applications
@@ -94,7 +98,9 @@ gtk_test_init (int    *argcp,
    * send events that GTK+ understands if XI2 is
    * disabled, bummer.
    */
+#ifdef GDK_WINDOWING_X11
   gdk_disable_multidevice ();
+#endif
 
   gtk_init ();
 }